home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / var / lib / dpkg / info / passwd.postinst < prev    next >
Encoding:
Text File  |  2009-04-04  |  1.5 KB  |  53 lines

  1. #!/bin/sh -e
  2.  
  3. case "$1" in
  4. configure)
  5.     # Fix permissions on various log files from old versions of the debian
  6.     # installer, some unrelated to passwd but we decided to put the fix
  7.     # here since there was no better place. This can safely be removed
  8.     # after etch is released.
  9.     if dpkg --compare-versions "$2" lt "1:4.0.14-9"; then
  10.         for log in /var/log/base-config* \
  11.             $(find /var/log/debian-installer/ /var/log/installer/ -type f 2>/dev/null ); do
  12.         if [ -e "$log" ]; then
  13.             chmod 600 "$log"
  14.         fi
  15.             done
  16.     fi
  17.  
  18.     # Fix root password of '!' for vm-builder installed instances. Unrelated
  19.     # to passwd, but seems best place. /var/log/installer won't exist in
  20.     # vm-builder created images
  21.     if dpkg --compare-versions "$2" lt-nl "1:4.1.1-5ubuntu3" && \
  22.        test ! -d "/var/log/installer"; then
  23.         if printf '!\0' | unix_chkpwd root nullok ; then
  24.             echo 'root:!' | chpasswd -e
  25.         fi
  26.     fi
  27.  
  28.     rm -f /etc/pam.d/passwd.pre-upgrade 2>/dev/null
  29.     if ! getent group shadow | grep -q '^shadow:[^:]*:42'
  30.     then
  31.         groupadd -g 42 shadow || (
  32.                 cat <<EOF
  33. Group ID 42 has been allocated for the shadow group.  You have either
  34. used 42 yourself or created a shadow group with a different ID.
  35. Please correct this problem and reconfigure with ``dpkg --configure passwd''.
  36.  
  37. Note that both user and group IDs in the range 0-99 are globally
  38. allocated by the Debian project and must be the same on every Debian
  39. system.
  40. EOF
  41.                 exit 1
  42.         )
  43.     fi
  44.     ;;
  45. esac
  46.  
  47. # Run shadowconfig only on new installs
  48. [ -z "$2" ] && shadowconfig on
  49.  
  50.  
  51.  
  52. exit 0
  53.